home *** CD-ROM | disk | FTP | other *** search
/ UpTime Volume 2 #3 / utv2n3s2.d64 / vision division (.txt) < prev   
Commodore BASIC  |  2022-08-28  |  7KB  |  233 lines

  1. 1 clr
  2. 10 poke53280,0:poke53281,0
  3. 11 print chr$(14)
  4. 15 a1=1
  5. 20 dims(9),s$(11),se$(11),nu$(10,3)
  6. 100 gosub4000
  7. 105 gosub10000
  8. 107 gosub 6000:gosub 7000
  9. 110 gosub 490
  10. 120 h=0:v=10:tx$="[196]o you need a lesson? ([217]/[206])":gosub 600:gosub 7020:gosub 410
  11. 150 ifa$="y"ora$="[217]"thengosub20000
  12. 160 gosub2000
  13. 165 ru=1
  14. 170 gosub2100
  15. 172 ifop<>3then190
  16. 174 gosub7000:gosub490
  17. 176 gosub3000:gosub 7000
  18. 190 gosub 490:h=0:v=10
  19. 192 tx$="[196]o you want to play again? ([217]/[206])":gosub 600:gosub 7020:gosub 410
  20. 220 ifa$="y"ora$="[217]"then160
  21. 230 sys 8*4096+4
  22. 300 nn=nn+1:rw=int(rnd(0)*6)+1:forj=1to4:v=16
  23. 310 tx$=chr$(co(j))+rw$(rw)+chr$(5):gosub 690:delay=.2:gosub 940:if j=4 then330
  24. 320 tx$="                                      ":gosub690:delay=.05:gosub940
  25. 330 nextj:return
  26. 400 poke 198,0
  27. 402 get a$:if a$="" then 402
  28. 404 return
  29. 410 gosub 400: if a$="y" or a$="[217]" or a$="n" or a$="[206]" then print a$:return
  30. 411 if a$="[140]" then gosub7000:goto 172
  31. 412 goto 410
  32. 420 gosub 400:a=val(a$):if a>=0 and a<=9 then return
  33. 421 goto 420
  34. 430 gosub 400: if a$="[140]" then gosub 7000:goto 172
  35. 431 if a$=chr$(13) then return
  36. 432 goto 430
  37. 440 gosub 420:if a$ <lo$ or a$>hi$ then 440
  38. 441 return
  39. 480 print"[147]":rem *** print screen (NULL) ***
  40. 481 tx$="vision software presents:":h=10:v=1:gosub 600:tx$=t$
  41. 482 print"";:h=10:v=3:gosub600
  42. 483 print"";:print:gosub 800:return
  43. 490 print"[147]": rem *** print screen input# ***
  44. 491 tx$="[145][214][201][211][201][207][206][160][211][207][198][212][215][193][210][197]":h=9:v=0:gosub600
  45. 492 tx$="and [213]p[212]ime [205]agazine [208]resents:":h=9:v=1:gosub 600
  46. 497 tx$="[194]asic [196]ivision [198]acts"
  47. 498 print"";:h=9:v=3:gosub 600
  48. 499 print"";:print:gosub 800:return
  49. 600 rem *** hor/ver tab ***
  50. 610 print"";:forq=1tov
  51. 620 print"";:next
  52. 630 printtab(h);tx$;:return
  53. 690 rem *** center text ***
  54. 691 ln=len(tx$):h=int(40-ln)/2:gosub 600:return
  55. 800 rem *** line across screen ***
  56. 810 print"";:forq=1to20
  57. 820 print"[192][192]";:nextq
  58. 830 print"";:return
  59. 900 v=24:h=8:tx$=" <[210][197][212][213][210][206]> to [195]ontinue. [146]":gosub600:gosub 430:return
  60. 910 v=24:h=2:tx$=" <return> to continue, <f8> to exit [146]"
  61. 920 gosub 600:gosub 430:return
  62. 940 rem *** timer ***
  63. 941 ti$="000000"
  64. 942 ifti/60<delaythen 942
  65. 944 return
  66. 1000 rem *** math routine ***
  67. 1020 s(1)=int(rnd(1)*6)+1:s(2)=int(rnd(1)*8)+2:s(3)=s(1)*s(2):return
  68. 2000 nn=0:ifru=1then2020:rem **student info**
  69. 2010 h=0:v=10:tx$="[215]hat's your first name?     [157][157][157][157]":gosub 600
  70. 2015 mx=15:gosub 5000:na$=te$
  71. 2020 v=10:h=0:tx$="[215]ould you like to:                      ":gosub 600:h=7:v=12
  72. 2030 fori=1to3:tx$=str$(i)+". "+op$(i):gosub 600:v=v+2:nexti:h=0
  73. 2040 tx$="[217]our choice? (1-3) ":gosub 600:lo$="1":hi$="3":gosub 440:printa$
  74. 2050 a=val(a$):op=a:hi=10:ifop=1then hi$="5":hi=5
  75. 2060 v=20:h=0:tx$="[200]ow many problems do you want  ":gosub 600
  76. 2070 v=21:tx$="to do (2 -"+str$(hi)+") ":if op<>1 then gosub 600:goto 2080
  77. 2075 tx$="to do (1 - 5) ":gosub 600:gosub 440:goto 2090
  78. 2080 gosub 420:if a=1 then printa;:np=10:lo$="0":hi$="0":gosub440:printa:return
  79. 2090 np=a:return
  80. 2100 rem *** central routine ***
  81. 2110 print"[147]";chr$(142);:k=0:fori=1tonp:k=k+1:gosub7000:gosub 1000:gosub 480
  82. 2120 gosub 7020:gosub 2200:gosub 910:printchr$(142);:nexti: return
  83. 2200 rem *** see examples ***
  84. 2202 ifs(3)<10thens=s(3):goto2212
  85. 2204 v=7:h=0:tx$=str$(int(s(3)/10))
  86. 2207 forj=1to3:tx$=nu$(int(s(3)/10),j):gosub 600:v=v+1:next j
  87. 2211 s=s(3)-int(s(3)/10)*10
  88. 2212 v=7:h=3:tx$=str$(int(s(3)))
  89. 2215 forj=1to3:tx$=nu$(s,j):gosub 600:v=v+1:next j
  90. 2220 forj=1to3:v=6+j:h=11:tx$=nu$(s(2),j):gosub 600:next j
  91. 2230 v=7:h=7 :tx$=" [209] [157][157][157][192][192][192][157][157][157] [209] ":gosub 600
  92. 2231 ifop=3then17000
  93. 2232 v=20:h=0:tx$="make"+str$(s(3))+" objects in rows of"+str$(s(2))+"."
  94. 2240 gosub 600:delay=1:gosub940:g=int(rnd(1)*6)+1:co=int(rnd(1)*4)+1
  95. 2245 forj=0tos(1):v=2*j+3+(9-s(1)):tx$=str$(s(2)*j):h=17+(10-s(2))-len(tx$)
  96. 2250 :ifj=0thentx$=""
  97. 2255 gosub600:tx$="":forkk=1tos(2)
  98. 2260 ifj<>0thentx$=tx$+" "+chr$(co(co))+g$(g)+""
  99. 2270 ifj=0thentx$=tx$+str$(kk)
  100. 2275 nextkk
  101. 2280 h=17+(10-s(2)):gosub600:nextj
  102. 2300 if op<>2then delay=3:gosub 940
  103. 2310 v=20:h=0:tx$="count the rows to find the quotient.":gosub 600
  104. 2311 ifop=2then2350
  105. 2312 forj=1tos(1):v=2*j+3+(9-s(1))
  106. 2320 h=15+(10-s(2))+(s(2)+1)*2
  107. 2325 tx$="[159]"+str$(j)+""
  108. 2330 gosub600:delay=.5:gosub940:nextj
  109. 2350 v=14:h=7:tx$=str$(s(1)):if rev=1 then return
  110. 2360 ifop=2thengosub15000
  111. 2370 forj=1to3:tx$=nu$(s(1),j):gosub 600:v=v+1:nextj:return
  112. 3000 print chr$(14):pct=(nn/k)*100:pct=pct+.5:pct=int(pct)
  113. 3010 v=7:h=0:tx$="[217]ou got"+str$(nn)+" right out of"+str$(k)+" problems":gosub600
  114. 3020 v=8:tx$="for"+str$(pct)+"%.":gosub 600
  115. 3090 gosub 7020:gosub 900:return
  116. 4000 rem *** read data ***
  117. 4005 readt$
  118. 4010 fori=1to6:read rw$(i):next i
  119. 4040 fori=1to3:read op$(i):next i
  120. 4070 fori=1to4:read co(i):next i
  121. 4091 fori=0to9:for j=1 to 3:read nu$(i,j):next j:next i
  122. 4096 fori=1to6:read g$(i):next i:return
  123. 4100 rem *** program data ***
  124. 4110 data"basic division facts"
  125. 4120 data"great!","fantastic!","super!"
  126. 4130 data"you're really going now!","yes!  yes!  yes!","that's great!"
  127. 4140 data"[211]ee [197]xamples [196]one."
  128. 4150 data"[196]o [208]roblems with [200]elp."
  129. 4160 data"[196]o [208]roblems [217]ourself."
  130. 4170 data28,30,31,158
  131. 4180 data"[213][192][201]","[221] [221]","[202][192][203]"
  132. 4190 data" [174] "," [221] "," [177] "
  133. 4200 data"[213][192][201]","[213][192][203]","[173][192][195]"
  134. 4210 data"[213][192][201]"," [192][179]","[202][192][203]"
  135. 4220 data"[213] [174]","[173][192][219]","  [177]"
  136. 4230 data"[176][192][201]","[173][192][201]","[202][192][203]"
  137. 4240 data"[213][192][201]","[171][192][201]","[202][192][203]"
  138. 4250 data"[176][192][174]"," [213][203]"," [177] "
  139. 4260 data"[213][192][201]","[171][192][179]","[202][192][203]"
  140. 4270 data"[213][192][201]","[202][192][179]","[202][192][203]"
  141. 4280 data"[215]","[209]","[211]","[193]","[218]"," [146]"
  142. 5000 te$="":print"[164]";
  143. 5010 get a$:if a$="" then 5010
  144. 5020 if a$=chr$(13) then printchr$(20):return
  145. 5030 if a$=chr$(20) and te$="" then 5010
  146. 5035 if a$=chr$(20) then printa$a$"[164]";:te$=left$(te$,len(te$)-1):goto 5010
  147. 5036 if a$="[140]" then gosub 7000:goto 172
  148. 5037 if len(te$)=mx then 5010
  149. 5040 if a$<" " or a$>"[218]" then 5010
  150. 5050 if a$>"z" and a$<"[193]" then 5010
  151. 5060 printchr$(20)a$"[164]";
  152. 5070 te$=te$+a$
  153. 5080 goto 5010
  154. 6000 gosub 7000:gosub 490:print
  155. 6010 print tab(7)"[158][161][146][161][161][146][161] [187][172][146] [172][172][187][146][187] [187][172][146] [172][172][187][146][187] [161][188][161][146][161]"
  156. 6020 print tab(7)"[161][146][161][161][146][161] [161][146][161] [188][188][146][162]  [161][146][161] [161][146][161][161][146][161] [161]  [146][161]"
  157. 6030 print tab(7)"[188][188][190][146][190] [161][146][161] [172][187][161][146][161] [161][146][161] [161][146][161][161][146][161] [161][146][161][187][146][161]"
  158. 6040 print tab(7)" [188][190]  [162][162][146]  [162][162][146]  [162][162][146]  [162][162][146]  [188][190][188][190]"
  159. 6050 printtab(3)"[161][172][188][146]  [187][172][146] [161][146][161][161][146][161] [187][172][146] [172][172][187][146][187] [187][172][146] [172][172][187][146][187] [161][188][161][146][161]"
  160. 6060 printtab(3)"[161][146][161][161][146][161] [161][146][161] [161][146][161][161][146][161] [161][146][161] [188][188][146][162]  [161][146][161] [161][146][161][161][146][161] [161]  [146][161]"
  161. 6070 printtab(3)"[161][146][161][190][146][190] [161][146][161] [188][188][190][146][190] [161][146][161] [172][187][161][146][161] [161][146][161] [161][146][161][161][146][161] [161][146][161][187][146][161]"
  162. 6080 printtab(3)"[188][162][146][190]  [162][162][146]  [188][190]  [162][162][146]  [162][162][146]  [162][162][146]  [162][162][146]  [188][190][188][190]"
  163. 6090 printtab(8)"[159][208]ress [210][197][212][213][210][206][159] to [195]ontinue"
  164. 6100 print"[152] [208]ublished by [211]oftdisk [208]ublishing, [201]nc."
  165. 6110 poke53269,1:poke 198,0:gosub 7020
  166. 6120 get a$:if a$<>chr$(13) then 6120
  167. 6130 return
  168. 7000 poke 53265,11
  169. 7010 return
  170. 7020 poke 53265,27
  171. 7030 return
  172. 10000 rem *** do spritey th